#include<iostream>
#include<cmath>

using namespace std;

void sushu()
{
	long long n;
	cin >> n;
	for (long long i=2;i*i<=n;i++)
	{
		if (n%i==0)
		{
			cout << "NO";
			return ;
		}
	}
	cout << "YES";
}

int main()
{
	sushu();
	return 0;	
} 
